package zheezes.eisp.monitor.model;

import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;

import zheezes.eisp.data.dao.DataAccessor;
import zheezes.eisp.data.orm.TermPo;


public class TermListFactory {
	private DataAccessor dataAccessor;

	private ResourceBundle resourceBundle;

	public List<TermVo> create() {
		List<TermPo> res = dataAccessor.queryAllTerms();

		List<TermVo> list = new ArrayList<TermVo>();
		if (res != null) {
			for (Object o : res) {
				TermVo vo = new TermVo();
				vo.setModel((TermPo) o);
				vo.setResourceBundle(resourceBundle);
				list.add(vo);
			}
		}
		return list;
	}

	public void setDataAccessor(DataAccessor dataAccessor) {
		this.dataAccessor = dataAccessor;
	}

	public void setResourceBundle(ResourceBundle resourceBundle) {
		this.resourceBundle = resourceBundle;
	}
}
